<?php
/**
 * YImageInterface.php
 *
 * @author Hua Yang <htmlcook@gmail.com>
 * @since 2.0
 */

/**
 * Interface YImageInterface
 */
interface YImageInterface
{
	const IMG_FLIP_HORIZONTAL = 1;

	const IMG_FLIP_VERTICAL = 2;

	const IMG_FLIP_BOTH = 0;

	const THUMBNAIL_INSET = 'inset';

	const THUMBNAIL_OUTBOUND = 'outbound';

	/**
	 * @param $with
	 * @param $height
	 * @return YImageInterface
	 */
	public function resize($with, $height);

	/**
	 * @param $width
	 * @param $height
	 * @param mixed $left
	 * @param mixed $top
	 * @return YImageInterface
	 */
	public function crop($width, $height, $left = 'center', $top = 'center');

	/**
	 * @param $angle
	 * @return YImageInterface
	 */
	public function rotate($angle);

	/**
	 * @param $mode
	 * @return YImageInterface
	 */
	public function flip($mode);

	/**
	 * @param $path
	 * @param array $options
	 * @return YImageInterface
	 */
	public function save($path, array $options = array());

	/**
	 * @param $format
	 * @param array $options
	 * @return YImageInterface
	 */
	public function show($format, array $options = array());

	/**
	 * @param $width
	 * @param null $height
	 * @param string $mode
	 * @return YImageInterface
	 */
	public function thumbnail($width, $height = null, $mode = self::THUMBNAIL_INSET);

	/**
	 * @return YImageInterface
	 */
	public function copy();

	/**
	 * @return array
	 */
	public function getSize();
}